package com.otitan.la.forest.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 菜单表
 *
 * @author jiacs
 * @email xxx
 * @date 2020-09-15 10:34:19
 */
@Data
@TableName("\"SYS_MENU\"")
@ApiModel("菜单表实体")
public class MenuEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ApiModelProperty(value = "主键", required = false)
    @TableId("\"ID\"")
    private String id;

    /**
     * 菜单名称
     */
    @ApiModelProperty(value = "菜单名称", required = true)
    @NotEmpty(message = "菜单名称不能为空")
    @Length(max = 20, message = "菜单名称不能超过 20 个字符")
    @TableField("\"NAME\"")
    private String name;

    /**
     * 父级节点
     */
    @ApiModelProperty(value = "父级节点", required = true)
    @NotEmpty(message = "父级节点不能为空")
    @Length(max = 36, message = "父级节点不能超过 36 个字符")
    @TableField("\"PARENT_ID\"")
    private String parentId;

    /**
     * 菜单等级
     */
    @ApiModelProperty(value = "菜单等级", required = true)
    @NotNull(message = "菜单等级不能为空")
    @Max(value = 999, message = "菜单等级不能超过 999")
    @Min(value = 0, message = "菜单等级不能小于 0")
    @TableField("\"GRADE\"")
    private Integer grade;

    /**
     * 菜单排序
     */
    @ApiModelProperty(value = "菜单排序", required = true)
    @NotNull(message = "菜单排序不能为空")
    @Max(value = 999, message = "菜单排序不能超过 999")
    @Min(value = 0, message = "菜单排序不能小于 0")
    @TableField("\"ORDER_NO\"")
    private Integer orderNo;

    /**
     * 菜单图标
     */
    @ApiModelProperty(value = "菜单图标", required = false)
    // @NotEmpty(message = "菜单图标不能为空")
    // @Length(max = 60, message = "菜单图标不能超过 60 个字符")
    @TableField("\"ICON\"")
    private String icon;

    /**
     * 路由路径
     */
    @ApiModelProperty(value = "路由路径", required = true)
    @NotEmpty(message = "路由路径不能为空")
    @Length(max = 30, message = "路由路径不能超过 30 个字符")
    @TableField("\"PATH\"")
    private String path;

    /**
     * 组件名
     */
    @ApiModelProperty(value = "组件名", required = false)
     @Length(max = 128, message = "组件名不能超过 128 个字符")
    @TableField("\"COMPONENT\"")
    private String component;

    /**
     * 英文名称
     */
    @ApiModelProperty(value = "英文名称", required = false)
     @Length(max = 128, message = "英文名称不能超过 128 个字符")
    @TableField("\"EN_DESC\"")
    private String enDesc;

    /**
     * 菜单编码
     */
    @ApiModelProperty(value = "菜单编码", required = true)
    @NotEmpty(message = "菜单编码不能为空")
    @Length(max = 64, message = "菜单编码不能超过 64 个字符")
    @TableField("\"MENU_CODE\"")
    private String menuCode;


    /**
     * 是否删除
     */
    @ApiModelProperty(value = "是否删除", required = false)
    @TableField(value = "\"IS_DELETE\"", fill = FieldFill.INSERT)
    @TableLogic  //逻辑删除注解
    @JsonIgnore  //忽略
    private Integer isDelete;

    /**
     * 创建用户
     */
    @ApiModelProperty(value = "创建用户", required = false)
    @TableField(value = "\"CREATE_USER\"", fill = FieldFill.INSERT)
    private String createUser;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", required = false)
    @TableField(value = "\"CREATE_DATE\"", fill = FieldFill.INSERT)
    private Date createDate;

    /**
     * 编辑用户
     */
    @ApiModelProperty(value = "编辑用户", required = false)
    @TableField(value = "\"UPDATE_USER\"", fill = FieldFill.INSERT_UPDATE)
    private String updateUser;

    /**
     * 编辑时间
     */
    @ApiModelProperty(value = "编辑时间", required = false)
    @TableField(value = "\"UPDATE_DATE\"", fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;

    /**
     * 应用编码
     */
    @ApiModelProperty(value = "应用编码", required = true)
    @NotEmpty(message = "应用编码不能为空")
    @Length(max = 36, message = "应用编码不能超过 36 个字符")
    @TableField("\"APP_CODE\"")
    private String appCode;


}
